package com.huarui.companypackage.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.ewaf.framework.action.BaseAction;

import com.huarui.companypackage.model.CompanyPackageService;
import com.huarui.companypackage.service.CompanyPackageServerService;

public class PackageServiceAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6936805426160387826L;
	private Logger log = Logger.getLogger(PackageServiceAction.class);
	private CompanyPackageServerService companyPackageServerService;
	private String queryParam;
	private Map<String, Object> jsonResult;
	
	public String searchPackageService(){
		jsonResult = new HashMap<String, Object>();
		try {
			List<CompanyPackageService> packageServices = companyPackageServerService.getPackageServiceByPackageId(Integer.valueOf(queryParam));
			jsonResult.put("root", packageServices);
			jsonResult.put("msg", "查询套餐内容成功......");
		} catch (Exception e) {
			log.error("查询套餐内容失败......",e);
			jsonResult.put("success", false);
			jsonResult.put("msg", "查询套餐内容失败......");
		}
		return SUCCESS;
	}

	public void setCompanyPackageServerService(
			CompanyPackageServerService companyPackageServerService) {
		this.companyPackageServerService = companyPackageServerService;
	}

	public void setQueryParam(String queryParam) {
		this.queryParam = queryParam;
	}

	public Map<String, Object> getJsonResult() {
		return jsonResult;
	}

	public void setJsonResult(Map<String, Object> jsonResult) {
		this.jsonResult = jsonResult;
	}

}
